package Reflection;

import org.springframework.web.bind.annotation.RequestMapping;

import java.lang.annotation.Annotation;

/**
 * Created by admin on 2016-10-28.
 */

public class TheClass extends testt{

    @RequestMapping
    public void doSomething(){}


    public static void main(String[] args) throws NoSuchMethodException {
        Class clazz=TheClass.class;
        Annotation[] annotations= clazz.getAnnotations();
        for (Annotation annotation:annotations){
            System.out.println(annotation.annotationType().getName());
        }

        System.out.println("-------------------方法--------------------");

        Annotation[] annotations1=clazz.getMethod("test").getAnnotations();
        for (Annotation annotation:annotations1){
            System.out.println(annotation.annotationType().getName());
        }
    }
}
